<template>
  <div>
    <el-card>
      <div class="box">
        <el-image :src="userStore.avatar" class="avatar"></el-image>
        <div class="content">
          <h3 class="title">{{ getTime() }}好{{ userStore.username }}</h3>
          <p class="desc">这是一个基于 Vue 3 的后台管理系统</p>
        </div>
      </div>
    </el-card>
    <div class="welcome">
      <svg-icon name="welcome" width="400px" height="400px"></svg-icon>
    </div>
  </div>
</template>

<script setup lang="ts" name="home">
import useUserStore from '@/store/modules/user.ts'
import { getTime } from '@/utils/time.ts'
import SvgIcon from '@/components/SvgIcon/index.vue'
let userStore = useUserStore()
</script>

<style scoped lang="scss">
.box {
  display: flex;

  .avatar {
    border-radius: 50%;
    width: 100px;
    height: 100px;
  }
  .content {
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    .title {
      font-size: 20px;
      font-weight: bold;
    }
    .desc {
      margin-top: 10px;
      font-size: 14px;
      color: #999;
    }
  }
}
.welcome {
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
